home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
55716
/
55716.xpi
/
chrome
/
content
/
bookmarks-button.js
next >
Wrap
Text File
|
2009-12-20
|
1KB
|
34 lines
window.addEventListener("load", function () {
var button = document.getElementById("bookmarks-button");
if (!button) {
Array.some(gNavToolbox.palette.childNodes, function (item) {
if (item.id == "bookmarks-button") {
button = item;
return true;
}
return false;
});
}
button.setAttribute("oncommand", "toggleBookmarksToolbar();");
button.setAttribute("observes", "bookmarks-button-proxy");
updateBookmarksButtonProxy();
var _onViewToolbarCommand = onViewToolbarCommand;
onViewToolbarCommand = function () {
_onViewToolbarCommand.apply(window, arguments);
updateBookmarksButtonProxy();
};
}, false);
function toggleBookmarksToolbar() {
var bar = document.getElementById("PersonalToolbar");
bar.setAttribute("collapsed", !bar.collapsed);
document.persist("PersonalToolbar", "collapsed");
updateBookmarksButtonProxy();
}
function updateBookmarksButtonProxy() {
document.getElementById("bookmarks-button-proxy")
.setAttribute("checked", !document.getElementById("PersonalToolbar").collapsed);
}